cancelModalCtrl.$inject = [
    '$scope',
    '$uibModalInstance',
    'orderService',
    'order'
]

function cancelModalCtrl($scope, $uibModalInstance, orderSvc, order) {
    var mctrl = this;
    
    mctrl.say='hello cancel';
    console.log('inmodal order detail');
    console.log(order);
    mctrl.cancel = function() {
        console.log('cancel operation come in...');
        $uibModalInstance.dismiss('cancel');
    }

    mctrl.confirm = function() {
        console.log('confirm operation jinlaile ');
        console.log(order._id);
        orderSvc.updateOstateByOid(order._id,'5',function(err, order) {
            console.log('orderSvc.updateOstateByOid come in...');
            console.log(order._id);
            console.log(order);
            $uibModalInstance.close(order);
        });
    }

}

module.exports = cancelModalCtrl;
